<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="bolao" />
    <g:set var="entityName" value="${message(code: 'match.label', default: 'Match')}" />
    <title><g:message code="default.show.label" args="[entityName]" /></title>
  </head>
  <body>
  <div class="body">
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <div class="dialog">
      <fieldset>
        <legend><g:message code="default.show.label" args="[entityName]" /></legend>
        <table>
          <tbody>
            <tr class="prop">
              <td valign="top" class="name"><g:message code="match.matchNumber.label"/>:</td>
          <td valign="top" class="value">${match.matchNumber}</td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name"><g:message code="match.matchDate.label"/>:</td>
          <td valign="top" class="value"><g:formatDate date="${match.matchDate}" format="dd/MM/yyyy hh:mm"/></td>
          </tr>
          <tr class="prop">
            <td valign="top" class="name"><g:message code="match.venue.label"/>:</td>
            <td valign="top" class="value">${match.venue}</td>
          </tr>
          <tr class="prop">
            <td colspan="2" valign="top" class="value">
              <g:if test="${match?.team1?.flagImage?.size() > 0}">
               <img src="<g:createLink controller='team' action='renderFlagImage' id='${match?.team1?.id}'/>"/>
             </g:if>
              <g:link controller="team" action="show" id="${match?.team1?.id}">${match?.team1?.name.encodeAsHTML()}</g:link>&nbsp;
              <big>${match?.score1 ?: '___'}</big>&nbsp;x&nbsp;<big>${match?.score2 ?: '___'}</big>&nbsp;
              <g:link controller="team" action="show" id="${match?.team2?.id}">${match?.team2?.name?.encodeAsHTML()}</g:link>
              <g:if test="${match?.team2?.flagImage?.size() > 0}">
               <img src="<g:createLink controller='team' action='renderFlagImage' id='${match.team2?.id}'/>"/>
             </g:if>
            </td>
          </tr>
          </tbody>
        </table>
      </fieldset>
    </div>
    <div class="buttons">
      <g:form>
        <input type="hidden" name="id" value="${match?.id}" />
        <g:ifAnyGranted role="ROLE_ADMIN">
          <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
        </g:ifAnyGranted>
        <g:ifAnyGranted role="ROLE_SUPERVISOR">
          <span class="button"><g:actionSubmit class="edit" action="editScore" value="${message(code: 'button.editScore.label', default: 'Edit Score')}" /></span>
        </g:ifAnyGranted>
        <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
      </g:form>
    </div>
  </div>
</body>
</html>